#ifndef RASTERWIDGET_H
#define RASTERWIDGET_H

#include "rasterizer.h"

#include <QWidget>

class RasterWidget : public QWidget {
    Q_OBJECT
public:
    RasterWidget(QWidget *parent = nullptr);

    void render(std::function<void(void)> &callback);
    std::vector<float> eyePos();
    std::vector<float> lightDir();
    void setEyePos(std::vector<float> pos);
    void setLightDir(std::vector<float> dir);

signals:
    void sizeChanged();

protected:
    void paintEvent(QPaintEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    // void wheelEvent(QMouseEvent *event) override;

private:
    raster::Rasterizer rasterizer_;

    // for test
    QImage image_;
};

#endif // RASTERWIDGET_H
